<!--
*Author：富行天下团队
 *
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/AccountsMain.js此处编写
 -->
<template>
  <div>
    <view-grid
      ref="grid"
      :columns="columns"
      :detail="detail"
      :editFormFields="editFormFields"
      :editFormFileds="editFormFields"
      :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields"
      :searchFormFileds="searchFormFields"
      :searchFormOptions="searchFormOptions"
      :table="table"
      :extend="extend"
    >
    </view-grid>
  </div>
</template>

<script>
import extend from "@/extension/mall/AccountsMain.js";
import ViewGrid from "@/components/basic/ViewGrid.vue";
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: "account_code_fk",
        footer: "Foots",
        cnName: "应收账户",
        name: "AccountsMain",
        url: "/AccountsMain/",
        sortName: "createDate",
      },
      extend: extend,
      editFormFields: {
        modifier: "",
        modifyDate: "",
        modifyID: "",
        createDate: "",
        createID: "",
        creator: "",
        is_delete: "",
        account_code_fk: "",
        account_name: "",
        is_entryaccount: "",
        is_credit: "",
        credit_total: "",
        account_limit: "",
        warn_phone: "",
        warn_limit: "",
        temporary_limit: "",
        is_valid: "",
        is_autostop: "",
        effec_enddate: "",
        effec_startdate: "",
        contact: "",
        contact_phone: "",
        finance_notes: "",
        notes: "",
      },
      editFormOptions: [
        // [{"title":"修改人","field":"modifier"},
        //            {"title":"修改时间","field":"modifyDate"},
        //            {"title":"修改人ID","field":"modifyID","type":"number"},
        //            {"title":"创建时间","field":"createDate"},
        //            {"title":"创建人ID","field":"createID","type":"number"},
        //            {"title":"创建人","field":"creator"},
        //            {"title":"逻辑删除标志","field":"is_delete","type":"number"},
        //            {"title":"应收账户编号","required":true,"field":"account_code_fk","disabled":true}],
        [
          {
            title: "应收账户名称",
            required: true,
            field: "account_name",
            type: "text",
          },
          {
            title: "是否入账",
            required: true,
            field: "is_entryaccount",
            type: "switch",
          },
        ],
        [
          {
            title: "是否授信",
            required: true,
            field: "is_credit",
            type: "switch",
          },
          {
            title: "授信额度",
            required: true,
            field: "credit_total",
            type: "decimal",
          },
        ],
        [
          {
            title: "单笔挂账限额",
            required: true,
            field: "account_limit",
            colSize: 12,
            type: "decimal",
          },
        ],
        [
          {
            title: "警告限额",
            required: true,
            field: "warn_limit",
            type: "decimal",
          },
          {
            title: "警告手机",
            required: true,
            field: "warn_phone",
            type: "phone",
          },
        ],
        [
          {
            title: "临时限额",
            required: true,
            field: "temporary_limit",
            colSize: 12,
            type: "decimal",
          },
        ],
        [
          {
            title: "是否有效",
            required: true,
            field: "is_valid",
            type: "switch",
          },
          {
            title: "是否自动停用",
            required: true,
            field: "is_autostop",
            type: "switch",
          },
        ],
        [
          {
            title: "有效期，开始时间",
            required: true,
            field: "effec_startdate",
            type: "datetime",
          },
          {
            title: "有效期，结束时间",
            required: true,
            field: "effec_enddate",
            type: "datetime",
          },
        ],
        [
          { title: "联系人", required: true, field: "contact", type: "text" },
          {
            title: "联系人电话",
            required: true,
            field: "contact_phone",
            type: "phone",
          },
        ],
        [
          {
            title: "财务备注",
            required: true,
            field: "finance_notes",
            colSize: 12,
            type: "textarea",
          },
        ],
        [
          {
            title: "备注",
            required: true,
            field: "notes",
            colSize: 12,
            type: "textarea",
          },
        ],
      ],
      searchFormFields: {},
      searchFormOptions: [],
      columns: [
        {
          field: "account_name",
          title: "应收账户名称",
          type: "string",
          width: 120,
          require: true,
          align: "left",
          sortable: true,
        },
        {
          field: "modifier",
          title: "修改人",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 120,
          align: "left",
          sortable: true,
        },
        {
          field: "modifyID",
          title: "修改人ID",
          type: "int",
          width: 120,
          hidden: true,
          align: "left",
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 120,
          align: "left",
          sortable: true,
        },
        {
          field: "createID",
          title: "创建人ID",
          type: "int",
          width: 120,
          hidden: true,
          align: "left",
        },
        {
          field: "creator",
          title: "创建人",
          type: "string",
          width: 120,
          align: "left",
        },
        {
          field: "finance_notes",
          title: "财务备注",
          type: "string",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "is_delete",
          title: "逻辑删除标志",
          type: "int",
          width: 120,
          align: "left",
        },
        {
          field: "contact",
          title: "联系人",
          type: "string",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "contact_phone",
          title: "联系人电话",
          type: "string",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "is_valid",
          title: "是否有效",
          type: "int",
          width: 120,
          require: true,
          align: "left",
          bind: {
            key: "audit",
            data: [
              { key: 0, value: "否" },
              { key: 1, value: "是" },
            ],
          },
        },
        {
          field: "is_autostop",
          title: "是否自动停用",
          type: "int",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "effec_enddate",
          title: "有效期，结束时间",
          type: "datetime",
          width: 120,
          require: true,
          align: "left",
          sortable: true,
        },
        {
          field: "effec_startdate",
          title: "有效期，开始时间",
          type: "datetime",
          width: 120,
          require: true,
          align: "left",
          sortable: true,
        },
        {
          field: "is_entryaccount",
          title: "是否入账",
          type: "int",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "temporary_limit",
          title: "临时限额",
          type: "string",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "warn_phone",
          title: "警告手机",
          type: "string",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "warn_limit",
          title: "警告限额",
          type: "decimal",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "account_limit",
          title: "单笔挂账限额",
          type: "decimal",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "is_credit",
          title: "是否授信",
          type: "int",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "credit_total",
          title: "授信额度",
          type: "decimal",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "notes",
          title: "备注",
          type: "string",
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "account_code_fk",
          title: "应收账户编号",
          type: "string",
          width: 120,
          hidden: true,
          readonly: true,
          require: true,
          align: "left",
        },
      ],
      detail: {
        cnName: "#detailCnName",
        columns: [],
        sortName: "",
        key: "",
      },
    };
  },
};
export default vueParam;
</script>
